Skip to content

Conversation

@flip1995
Copy link
Member

r? @Manishearth

1 day late. Totally forgot about this yesterday.

AudaciousAxiom and others added 30 commits October 19, 2025 10:32
… r=jdonszelmann"

This reverts commit 5dc3c19, reversing
changes made to 11339a0.
will improve the diff for the next commit
- move `is_allowed_vec_method` (a stripped-down version of it, anyway,
  as the function doesn't make sense as is out of context) to utils, as
  it's shared between `useless_vec` and `ptr_arg`
- add another test for non-standard macro brace case
- rm unneeded `allow`s
- rm duplicated tests
- add comments to some tests
…ration_sugg`

This doesn't change any functionality, but will make it easier to switch
to a uniform message in the next commit. Also a nice simplification imo
changelog: [`sliced_string_as_bytes`]: don't fire on
`str[..].as_bytes()`

So I ran into this in some codebase I was working on,
where the lint fired on this line:
```rust
let string: &str;
string[..].as_bytes()
```
So I was trying to understand the rationale behind this lint, and it
says:
> It involves doing an unnecessary UTF-8 alignment check which is less
efficient, and can cause a panic.

This is obviously not true in the case where a `RangeFull` slice is
being taken, since there is no UTF-8 boundary check, and no panic can be
caused. So I created an exemption for `RangeFull`s.

Two other notes:
1. I'm not sure the word "alignment" in the lint's description (quoted
above) is really correct, should probably say "char boundary" instead?
2. I might be missing something, but isn't there a lint for doing
superfluous slice indexing, and then calling a slice method? e.g.
`str[..].len()` or `slice[..].len()`, where `str` and `slice` are `&str`
and `&[T]`, respectively. If we had one, I would expect *it* to fire for
the example code I quoted above.
matthiaskrgr and others added 9 commits November 27, 2025 15:59
…ffleLapkin

remove support for `typeof`

see rust-lang/compiler-team#940 closes rust-lang#148700

This also enables checks for invariants previously broken by `typeof` again.

r? types
… expansion (rust-lang#15958)

This means some existing test cases won't get linted anymore, but imo
that's preferable to false-positives.

Fixes rust-lang/rust-clippy#14548

changelog: [`equatable_if_let`]: don't lint if pattern or initializer
come from expansion
First commits fixes a display issue when JS is disabled. Before:

<img width="962" height="144" alt="image"
src="https://github.com/user-attachments/assets/d9ca8077-2486-49eb-9a99-bd396c0d67fa"
/>

After:

<img width="962" height="144" alt="Screenshot From 2025-11-18 14-12-52"
src="https://github.com/user-attachments/assets/a5f0c390-7e3c-4ad5-bb0d-95e0c1a1889b"
/>

The two other commits remove (each) one DOM level in the filters menu.

changelog: none

r? @Alexendoo
…ns (rust-lang#16102)

Currently the `sugg` utility treats all `ExprKind::Match` expressions as
potentially needing brackets, and therefore many lints will add
parenthesis around them. However this includes desugared match
expressions like the `?` and `.await` operators.

In this PR I have updated the utility to only treat match expressions
which include a code block as needing parenthesis, as the other types
have similar precedence rules and expectations to things like member
access and I think can be treated like as such.

While this change is small on paper it touches a large amount of code
due to changing a cross cutting concern, I am happy to add additional
tests if we think it is needed, but I wanted to get a feel for if this
is even a sensible change to be doing and what the expectations were
around the level of testing needed before investing more time into it.

Regarding not putting a specific lint in the changelog, determining all
the lints this could possibly effect would be possible but take some
time, and I wonder if it would be a bit too noisy in the changelog. Open
to suggestions about how best to address that.

fixes rust-lang/rust-clippy#16045

changelog: stop inserting unnecessary brackets around `x?` and `x.await`
expressions in suggestions
r? @ghost

changelog: none
@rustbot
Copy link
Collaborator

rustbot commented Nov 28, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. labels Nov 28, 2025
@rustbot

This comment has been minimized.

@flip1995 flip1995 force-pushed the clippy-subtree-update branch from 08be39b to 0a1fa79 Compare November 28, 2025 19:25
@rustbot
Copy link
Collaborator

rustbot commented Nov 28, 2025

⚠️ Warning ⚠️

@matthiaskrgr
Copy link
Member

@bors r+ p=1 subtree sync

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

📌 Commit 0a1fa79 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2025
@Manishearth
Copy link
Member

@bors r+ p=1 rollup=never

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

📌 Commit 0a1fa79 has been approved by Manishearth

It is now in the queue for this repository.

@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking tempfile v3.20.0
[RUSTC-TIMING] tempfile test:false 0.323
[RUSTC-TIMING] object test:false 6.212
    Checking rustc_codegen_gcc v0.1.0 (/checkout/compiler/rustc_codegen_gcc)
error: called `unwrap` on `bx.location` after checking its variant with `is_some`
   --> compiler/rustc_codegen_gcc/src/builder.rs:508:29
    |
506 |     if bx.location.is_some() {
    |     ------------------------ help: try: `if let Some(<item>) = bx.location`
507 |         #[cfg(feature = "master")]
508 |         rvalue.set_location(bx.location.unwrap());
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
    = note: `-D clippy::unnecessary-unwrap` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_unwrap)]`

@matthiaskrgr
Copy link
Member

lol
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 28, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 29, 2025
…gen-gcc-remove-unnecessary-unwrap, r=workingjubilee

Remove an unnecessary `unwrap` in `rustc_codegen_gcc`

This should hopefully unblock rust-lang#149425 (I couldn't find an in-flight PR that was already doing this).
I've tested  locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however).

I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.